<template>
  <el-dialog v-model="open" title="查看" width="600px" custom-class="view-result-image" @close="closeDialog">
    <ImagePreview :src="`/attachment/downLoadFile?attachId=${attachId}`" />
    <template #footer>
      <div style="text-align: right">
        <el-button plain @click="closeDialog">取消</el-button>
        <el-button type="primary" @click="closeDialog">确定</el-button>
      </div>
    </template>
  </el-dialog>
</template>
<script setup>
const props = defineProps({
  attachId: String,
  open: Boolean
})
const emits = defineEmits(['update:open'])
const closeDialog = () => emits('update:open', false)
</script>
<style lang="scss">
.el-dialog.view-result-image {
  .el-dialog__body {
    .el-image {
      display: block;
      margin: 0 auto;
    }
  }
}
</style>